import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
//vueSetup模式拓展插件
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
//自动引入API插件
import AutoImport from "unplugin-auto-import/vite"

export default defineConfig({
	// //https://ask.dcloud.net.cn/question/146179
	// define: { "process.env": {} },
	css: {
		postcss: {
			plugins: [
			]
		}
	},
	plugins: [
		uni(),
		vueSetupExtend(),
		AutoImport({
			dts: "./src/types/api-auto-imports.d.ts",
			imports: [
				"vue",
				"pinia",
				"uni-app",
				{
					'axios': [
						['default', 'axios']
					],
				},
			],
			resolvers: [
				// (name) => {
				// 	if (name.endsWith('Store')) {
				// 		console.log('自动引入Store-->', name)
				// 		return {
				// 			name: 'default',
				// 			from: `~/stores/${name}`,
				// 		}
				// 	}
				// },
			],
		}),
	],
});

